﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Top_Meeting
{
    class Configuration
    {
        public static string Account;
        public static string Password;

        //Calling
        public static string CallingID;

        public static string LayoutPath = "Layout";
        public static string FontsPath = "Fonts";
        public static string Tip_Login_Err = "账号错误，请重新输入";

        public static List<string> MutilCallList = new List<string>();
        public static string MutilCallAddTip = "添加新的联系人";
        public static string MutilCallTitle = "正在与{0}人视频通话";
        public static string TipCalling_OffLine = "对方不在线";
        public static string TipCalling_Failed = "呼叫失败";
        public static string TipCalling_Busy = "对方正忙";
        public static string TipCalling_NotExist = "无此用户";
        public static string TipCalling_NoAnswer = "无应答";
        public static string TipCalling_Calling = "正在呼叫，请稍后";
        public static string TipCalling_Disconnect = "挂断";

        //Form_Main_Menu
        public static string StrConference = "视频会议";
        public static string StrVideoPlayBack = "视频回看";
        public static string StrContact = "联系人";
        public static string StrSetting = "设置中心";
        public static string StrUser = "用户中心";
        public static bool Main_Meni_AutoOpen = false;

        //Contact
        private static List<string> contactList = new List<string>();
        public static List<string> ContactList { get { return contactList; } set { contactList = value; } }
        private static List<string> deleteAccountList = new List<string>();
        public static List<string> DeleteAccountList { get { return deleteAccountList; } }

        public static Color Color_DefultFore = Color.FromArgb(57, 243, 255);

        //Setting


        //User
        public static List<string> UserVideoList = new List<string>();



        #region PUBLIC_METHOD

        public static void Init()
        {
            CreatContacts();
            CreatMutilCall();
            CreatUserVideo();
        }

        public static void AddAccountToDeleteList(string _account)
        {
            if (DeleteAccountList.Contains(_account))
                return;
            DeleteAccountList.Add(_account);
        }

        public static void RemoveAccountInDeleteList(string _account)
        {
            if (!DeleteAccountList.Contains(_account))
                return;
            DeleteAccountList.Remove(_account);
        }

        public static void RemoveAccountInDeleteList(int _accountIndex)
        {
            if (_accountIndex < 0 || _accountIndex >= DeleteAccountList.Count)
                return;
            DeleteAccountList.RemoveAt(_accountIndex);
        }

        public static void ClearDeleteAccountList()
        {
            if (DeleteAccountList != null)
                DeleteAccountList.Clear();
        }

        #endregion

        //Test
        private static void CreatContacts()
        {
            Random random = new Random();
            for (int i = 0; i < 20; i++)
            {
                ContactList.Add(random.Next(100, 1000).ToString());
            }
        }

        private static void CreatMutilCall()
        {
            Random random = new Random();
            for (int i = 0; i < 4; i++)
            {
                MutilCallList.Add(random.Next(100, 1000).ToString());
            }
        }

        private static void CreatUserVideo()
        {
            Random random = new Random();
            for (int i = 0; i < 100; i++)
            {
                UserVideoList.Add(random.Next(100, 1000).ToString());
            }
        }
    }

    public enum AlignType
    {
        None = 0,
        Horizontal = 1,
        Vertical = 2,
        Center = 4,
        Left = 8,
        Top = 16,
        Right = 32,
        Bottom = 64,
        LeftTop = 128,
        LeftBottom = 256,
        RightTop = 512,
        RightBottom = 1024,

    }
}
